#include "MWDebug.h"
#include "MWMemory.h"

#ifdef MW_PLATFORM_WIN32
#include <windows.h>
#else
#error "not support other platform"
#endif

#pragma warning(disable : 4996)

using namespace Myway;

void Myway::Output(const char * fmt, ...)
{
	const int TEXT_BUFFER_SIZE = 10240;
	char text[TEXT_BUFFER_SIZE];
	va_list arglist;

	va_start(arglist, fmt);
	vsprintf(text, fmt, arglist);
	va_end(arglist);

#ifdef MW_PLATFORM_WIN32

	OutputDebugString(text);

#else

    #error "not support other platform"

#endif
}

void Myway::EnableMemoryLeakCheck()
{
    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
}

void Myway::BreakAllock(int time)
{
    _CrtSetBreakAlloc(time);
}